﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="NewDefaultAdd.aspx.cs" Inherits="manager_task_NewDefaultAdd" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>发布任务</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">
    <section class="content-header">
        <h1>任务相关
            <small>为<a style="color: red"><%=ttitle %></a>发布任务</small>
        </h1>
        <ol class="breadcrumb">
            <li><a><i class="fa fa-dashboard"></i>主页</a></li>
            <li><a href="userManager.aspx">任务相关</a></li>
            <li class="active">发布任务</li>
        </ol>
    </section>

    <section class="content">
        <div class="box box-primary">
            <div class="box-body">
                <table class="table table-bordered">
                    <tr>
                        <td class="col-sm-1">状态</td>
                        <td>
                            <asp:DropDownList ID="ddlIsUsing" CssClass="form-control" runat="server">
                                <asp:ListItem Value="1">正常</asp:ListItem>
                                <asp:ListItem Value="0">作废</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td style="vertical-align: middle">任务发布</td>
                        <td>
                            <input type="text" id="txt_fb_username" class="form-control" placeholder="任务发布人,如;王总，李总，张经理" runat="server" /></td>
                    </tr>
                    <tr>
                        <td style="vertical-align: middle">任务标题</td>
                        <td>
                            <input type="text" id="txt_title" class="form-control" runat="server" /></td>
                    </tr>
                    <tr>
                        <td style="vertical-align: middle">任务描述</td>
                        <td>
                            <textarea class="form-control" style="height: 100px;" id="txt_ms" runat="server"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td style="vertical-align: middle">开始日期</td>
                        <td>
                            <input type="text" id="txt_rq_start" class="form-control" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td style="vertical-align: middle">结束日期</td>
                        <td>
                            <input type="text" id="txt_rq_yjs" class="form-control" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td style="vertical-align: middle">验收岗位</td>
                        <td>
                            <a data-toggle="modal" data-target="#moduleManager">
                                <input type="text" id="ys_psid_mc" class="form-control" placeholder="必填，任务由谁来验收" runat="server" /></a>
                        </td>
                    </tr>
                </table>
                <table class="table table-bordered" id="html_type_1" runat="server">
                    <tr>
                        <td class="col-sm-1" style="vertical-align: middle">岗位考评</td>
                        <td><a data-toggle="modal" data-target="#moduleManager_ps1">
                            <input type="text" id="eval_ps_mc" class="form-control" runat="server" placeholder="必填，对本岗位考评条目" /></a>
                        </td>
                    </tr>
                </table>
                <table class="table table-bordered" id="html_type_2" runat="server">
                    <tr>
                        <td class="col-sm-1" style="vertical-align: middle">主管考评</td>
                        <td><a data-toggle="modal" data-target="#moduleManager_ps2">
                            <input type="text" id="eval_parps_mc" class="form-control" runat="server" placeholder="选填，此任务是否影响主管考评" /></a>
                        </td>
                    </tr>
                </table>
                <table class="table table-bordered" id="html_type_3" runat="server">
                    <tr>
                        <td class="col-sm-1" style="vertical-align: middle">部门考评</td>
                        <td><a data-toggle="modal" data-target="#moduleManager_ps3">
                            <input type="text" id="eval_deptps_mc" class="form-control" runat="server" placeholder="选填，此任务是否影响部门考评" /></a>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="box-footer">
                <a href="NewDefault.aspx" class="btn btn-warning">取消</a>
                <asp:Button ID="Button1" runat="server" class="btn btn-primary pull-right" Text="保存" OnClick="Button1_Click" />
            </div>
        </div>

        <div class="modal fade" id="moduleManager" role="dialog" aria-labelledby="moduleManagerLabel">
            <div class="modal-dialog" role="document" style="width: 1000px">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="userManagerLabel">选择验收岗位(单击名称选择)</h4>
                    </div>
                    <div class="modal-body">
                        <ul class="nav nav-tabs" role="tablist">
                            <%=Html_Dept %>
                        </ul>
                        <div class="tab-content">
                            <%=Html_Dept_Detail %>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal fade" id="moduleManager_ps1" role="dialog" aria-labelledby="moduleManagerLabel">
            <div class="modal-dialog" role="document" style="width: 1000px">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">选择岗位考评(单击名称选择)</h4>
                    </div>
                    <div class="modal-body">
                        <table id="userManagerList" class="table table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th></th>
                                    <th>考核内容描述</th>
                                    <th>权重</th>
                                </tr>
                            </thead>
                            <tbody>
                                <asp:Repeater ID="rptDeApply_1" runat="server">
                                    <ItemTemplate>
                                        <tr style="cursor: pointer" onclick="Set_eval_ps('<%# Eval("id") %>','[<%# Eval("qz") %>]<%# Eval("mc") %>')">
                                            <td><%# Eval("id") %></td>
                                            <td class="col-sm-10"><%# Eval("mc") %></td>
                                            <td class="col-sm-2"><%# Eval("qz") %></td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal fade" id="moduleManager_ps2" role="dialog" aria-labelledby="moduleManagerLabel">
            <div class="modal-dialog" role="document" style="width: 1000px">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">选择主管考评(单击名称选择)</h4>
                    </div>
                    <div class="modal-body">
                        <table id="userManagerList1" class="table table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th></th>
                                    <th>考核内容描述</th>
                                    <th>权重</th>
                                </tr>
                            </thead>
                            <tbody>
                                <asp:Repeater ID="rptDeApply_2" runat="server">
                                    <ItemTemplate>
                                        <tr style="cursor: pointer" onclick="Set_eval_parps('<%# Eval("id") %>','[<%# Eval("qz") %>]<%# Eval("mc") %>')">
                                            <td><%# Eval("id") %></td>
                                            <td class="col-sm-10"><%# Eval("mc") %></td>
                                            <td class="col-sm-2"><%# Eval("qz") %></td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal fade" id="moduleManager_ps3" role="dialog" aria-labelledby="moduleManagerLabel">
            <div class="modal-dialog" role="document" style="width: 1000px">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">选择部门考评(单击名称选择)</h4>
                    </div>
                    <div class="modal-body">
                        <table id="userManagerList2" class="table table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th></th>
                                    <th>考核内容描述</th>
                                    <th>权重</th>
                                </tr>
                            </thead>
                            <tbody>
                                <asp:Repeater ID="rptDeApply_3" runat="server">
                                    <ItemTemplate>
                                        <tr style="cursor: pointer" onclick="Set_eval_deptps('<%# Eval("id") %>','[<%# Eval("qz") %>]<%# Eval("mc") %>')">
                                            <td><%# Eval("id") %></td>
                                            <td class="col-sm-10"><%# Eval("mc") %></td>
                                            <td class="col-sm-2"><%# Eval("qz") %></td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div style="display: none;">
            <input type="text" id="dept_id" runat="server" />

            <input type="text" id="zx_psid" runat="server" value="0" />
            <input type="text" id="ys_psid" runat="server" value="0" />
            <input type="text" id="eval_ps" runat="server" value="0" />
            <input type="text" id="eval_parps" runat="server" value="0" />
            <input type="text" id="eval_deptps" runat="server" value="0" />

             <input type="text" id="par_psid" runat="server" value="0" />
             <input type="text" id="dept_psid" runat="server" value="0" />

            <input type="text" id="Edit_Id" runat="server" value="0" />
        </div>
    </section>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptPlaceHolder" runat="Server">
    <script src="/reference/plugins/moment/moment.min.js"></script>
    <script src="/reference/plugins/moment/moment-with-locales.min.js"></script>
    <script src="/reference/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script>
        $('#ContentPlaceHolder_txt_rq_start').datetimepicker({
            locale: 'zh-cn',
            format: "YYYY-MM-DD"
        });
        $('#ContentPlaceHolder_txt_rq_yjs').datetimepicker({
            locale: 'zh-cn',
            format: "YYYY-MM-DD"
        });
        $(document).ready(function () {
            var type = $("#ContentPlaceHolder_dept_id").val();
            var arr_dept = type.split("|");
            for (var i = 0; i < arr_dept.length; i++) {
                $("#table_" + arr_dept[i]).DataTable(
                               {
                                   "columnDefs": [
                                       { "targets": [0], "visible": false }
                                   ],
                                   "autoWidth": true,
                                   "ordering": false,
                                   "scroll": true,
                                   "language": {
                                       "url": "/reference/plugins/datatables/Chinese.json"
                                   }
                               });
            }
            var type = $("#ContentPlaceHolder_type_value").val();
        });

        $(document).ready(function () {
            $("#userManagerList").DataTable(
                {
                    "columnDefs": [
                        { "targets": [0], "visible": false }
                    ],
                    "autoWidth": true,
                    "ordering": false,
                    "scroll": true,
                    "language": {
                        "url": "/reference/plugins/datatables/Chinese.json"
                    }
                });
        });

        $(document).ready(function () {
            $("#userManagerList1").DataTable(
                {
                    "columnDefs": [
                        { "targets": [0], "visible": false }
                    ],
                    "autoWidth": true,
                    "ordering": false,
                    "scroll": true,
                    "language": {
                        "url": "/reference/plugins/datatables/Chinese.json"
                    }
                });
        });

        $(document).ready(function () {
            $("#userManagerList2").DataTable(
                {
                    "columnDefs": [
                        { "targets": [0], "visible": false }
                    ],
                    "autoWidth": true,
                    "ordering": false,
                    "scroll": true,
                    "language": {
                        "url": "/reference/plugins/datatables/Chinese.json"
                    }
                });
        });

        function SetYsGw(id, mc) {
            $("#ContentPlaceHolder_ys_psid").val(id);
            $("#ContentPlaceHolder_ys_psid_mc").val(mc);
            $('#moduleManager').modal('hide')
        }

        function Set_eval_ps(id, mc) {
            $("#ContentPlaceHolder_eval_ps").val(id);
            $("#ContentPlaceHolder_eval_ps_mc").val(mc);
            $('#moduleManager_ps1').modal('hide');
        }

        function Set_eval_parps(id, mc) {
            $("#ContentPlaceHolder_eval_parps").val(id);
            $("#ContentPlaceHolder_eval_parps_mc").val(mc);
            $('#moduleManager_ps2').modal('hide');
        }
        function Set_eval_deptps(id, mc) {
            $("#ContentPlaceHolder_eval_deptps").val(id);
            $("#ContentPlaceHolder_eval_deptps_mc").val(mc);
            $('#moduleManager_ps3').modal('hide');
        }





    </script>
</asp:Content>

